<template>
	<view>
		<image class="newbg" src="../../static/newinvite.png" mode=""></image>
		<view class="newtop flex" :style="'padding-top' + safehigh +'px'">
			<u-icon name="arrow-left" @click="$back" class="u-m-l-40" color="#fff"></u-icon>
			<view class="rule" @click="show=true">活动规则</view>
		</view>
		<view class="suddently u-font-38 u-font-bold" @click="$goTo('pages_my/invite/invite')">
			立即邀请
		</view>
		<view class="small_box">
			<image class="babbg" src="../../static/one.png" mode=""></image>
		</view>
		<view class="invite_list ">
			<view class="flex-cneter">
				<image class="invitetitle" src="../../static/two.png" mode=""></image>
			</view>
			<scroll-view scroll-y="true" class="main" @scrolltolower="more">
				<view class="main_item flex" v-for="i in list">
					<view class="main_item_left flex">
						<image class="avator" :src="$oss(i.avatar)" mode=""></image>
						<view class="">{{i.nickname}}</view>
					</view>
					<view class="time">{{i.creattime|date}}</view>
				</view>
				<u-empty mode="list" v-if="finish && list.length === 0" style="margin-top: 200rpx;" icon="/static/none.png">
						</u-empty>
			</scroll-view>
		</view>
		<u-popup :show="show" @close="close" bgColor='transparent' mode='center' :round="20" @open="open">
			<view class="popbox">
				<view class="flex-cneter u-m-tb-50">活动规则</view>
				<view class="" v-html="content">
					
				</view>
			</view>
			<view class="flex-cneter u-m-t-50" @click="show=false">
				<image class="closes" src="/static/close.png" mode=""></image>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				safehigh: '',
				finish: false,
				page: 1,
				list:[],
				finshi:false,
				content:''
			};
		},
		onLoad() {
			this.safehigh = uni.getSystemInfoSync().statusBarHeight
			this.init()
			this.newinite()
		},
		methods: {
			more() {
				this.page++
				this.init()
			},
			newinite(){
				this.$api.post('/getconfig',{attr:'gamecontent'}).then(res=>{
					this.content = res.data
				})
			},
			open() {
				// console.log('open');
			},
			close() {
				this.show = false
				// console.log('close');
			},
			init() {
				this.$api.post('/reclist',{page:this.page}).then(res=>{
					console.log(res.data);
					this.list = [...this.list,...res.data]
					if(res.data.length<1){
						this.finish = true
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		position: relative;
		overflow: auto;
		// height: calc(100vh - var(--window-bottom) - var(--window-top));
		padding-top: var(--status-bar-height);
		padding-bottom: 30rpx;
	}

	.newbg {
		position: absolute;
		width: 100vw;
		height: 100%;
	}

	.newtop {
		justify-content: space-between;
		padding: 60rpx 0;
		align-items: center;
		position: relative;
		color: #fff;
		font-size: 26rpx;

		.rule {
			background: rgba(255, 255, 255, 0.4);
			border-radius: 30rpx 0 0 30rpx;
			padding: 10rpx 20rpx;
		}
	}

	.suddently {
		margin: 700rpx auto 30rpx;
		position: relative;
		background: linear-gradient(180deg, #FDE4AB 0%, #FEA556 100%);
		color: #A8590E;
		width: 490rpx;
		text-align: center;
		padding: 30rpx;
		border-radius: 50rpx;
	}

	.small_box {
		position: relative;
		width: 90vw;
		margin: 60rpx auto;
		border-radius: 30rpx;

		.babbg {
			width: 100%;
			height: 300rpx;
		}
	}

	.invite_list {
		width: 90vw;
		margin: 0rpx auto 60rpx;
		border-radius: 30rpx;
		background-color: #fff;
		position: relative;
		color: #A8590E;
		flex-direction: column;

		.invitetitle {
			width: 235rpx;
			height: 58rpx;
			margin: 0 auto;
		}

		.main {
			width: 100%;
			height: 500rpx;

			.main_item {
				padding: 30rpx;
				align-items: center;
				justify-content: space-between;

				.main_item_left {
					align-items: center;

					.avator {
						width: 60rpx;
						height: 60rpx;
						border-radius: 50%;
						margin-right: 30rpx;
					}
				}

				.time {
					color: #999999;
				}
			}
		}
	}
	.popbox{
		border-radius: 20rpx;
		width: 80vw;
		padding: 20rpx 30rpx;
		background-color: #fff;
	}
	.closes{
		width: 70rpx;
		height: 70rpx;
		// background-color: #000;
	}
</style>